import requests
# import httpx

#
# headers = {
#     'Cookie': 'PHPSESSID=7c8nj8rf1rm23a414pf5fp19go; __gads=ID=b594155f6196cdf8:T=1747795357:RT=1747967732:S=ALNI_MY4DkwRhSs8FHoHWxXJBJJPFB4vCg; __gpi=UID=000010c9950145ec:T=1747795357:RT=1747967732:S=ALNI_MYWfeahL1V26b6wmlZuiUxxkPCnLg; __eoi=ID=41f8bcd8d5110aa6:T=1747795357:RT=1747967732:S=AA-AfjYCCCiQ-trYEWyrBOxNhxJq',
#     'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
#     'Referer': 'https://fabiaoqing.com/'
# }
# response = requests.get('https://fabiaoqing.com/biaoqing/lists/page/1.html',headers=headers)
# print(response)
#
# response = requests.get('https://fabiaoqing.com/biaoqing/lists/page/1.html', verify=False)
# print(response)

# r = requests.get('https://fabiaoqing.com/biaoqing/lists/page/1.html')
# print(r)
import requests

url = "https://www.fabiaoqing.com/biaoqing/lists/page/1.html"

headers = {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Cache-Control": "max-age=0",
    "Connection": "keep-alive",
    "Sec-Fetch-Dest": "document",
    "Sec-Fetch-Mode": "navigate",
    "Sec-Fetch-Site": "same-origin",
    "Sec-Fetch-User": "?1",
    "Upgrade-Insecure-Requests": "1",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
    "sec-ch-ua": '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"',
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": '"Windows"'
}

cookies = {
    "PHPSESSID": "hj0nts0873dth5sdgmo9t2pq4q",
    "__gads": "ID=03e7982e41ef14f4:T=1747975428:RT=1747975428:S=ALNI_MbPkJNJaniWf1Z8LAF8-rUFH0hIhA",
    "__gpi": "UID=000010de36678f5a:T=1747975428:RT=1747975428:S=ALNI_MaByxNQo0DZiMrdv1INUqfI4EwNCg",
    "__eoi": "ID=90d030ddb4a3c424:T=1747975428:RT=1747975428:S=AA-AfjaYTMWsoovEZIAqgUQtxXCY"
}

try:
    # 添加SSL验证和适配器
    session = requests.Session()
    response = session.get(url, headers=headers, cookies=cookies, timeout=10,verify=r"C:\Users\C\Desktop\fabiaoqing.com.pem")
    response.raise_for_status()  # 检查请求是否成功
    print(response.text)  # 打印响应内容

except requests.exceptions.SSLError as e:
    print(f"SSL错误: {e}")



# import httpx
# url = "https://www.fabiaoqing.com/biaoqing/lists/page/1.html"
# headers = {
#     "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
#     "Accept-Language": "zh-CN,zh;q=0.9",
#     "Cache-Control": "max-age=0",
#     "Connection": "keep-alive",
#     "Sec-Fetch-Dest": "document",
#     "Sec-Fetch-Mode": "navigate",
#     "Sec-Fetch-Site": "same-origin",
#     "Sec-Fetch-User": "?1",
#     "Upgrade-Insecure-Requests": "1",
#     "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
#     "sec-ch-ua": '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"',
#     "sec-ch-ua-mobile": "?0",
#     "sec-ch-ua-platform": '"Windows"'
# }
#
# cookies = {
#     "PHPSESSID": "hj0nts0873dth5sdgmo9t2pq4q",
#     "__gads": "ID=03e7982e41ef14f4:T=1747975428:RT=1747975428:S=ALNI_MbPkJNJaniWf1Z8LAF8-rUFH0hIhA",
#     "__gpi": "UID=000010de36678f5a:T=1747975428:RT=1747975428:S=ALNI_MaByxNQo0DZiMrdv1INUqfI4EwNCg",
#     "__eoi": "ID=90d030ddb4a3c424:T=1747975428:RT=1747975428:S=AA-AfjaYTMWsoovEZIAqgUQtxXCY"
# }
# async def make_request():
#     # 创建自定义客户端配置
#     async with httpx.AsyncClient(
#             headers=headers,
#             cookies=cookies,
#             timeout=10.0,
#             verify=False,  # 禁用SSL验证（相当于requests的verify=False）
#             # 如果需要自定义SSL配置，可以使用以下参数：
#             # limits=httpx.Limits(max_connections=100),
#             # http2=True,  # 启用HTTP/2
#             # proxies="http://proxy.example.com:8080"  # 设置代理
#     ) as client:
#         try:
#             response = await client.get(url)
#             response.raise_for_status()  # 检查请求是否成功
#             print(response.text)  # 打印响应内容
#
#         except httpx.HTTPStatusError as e:
#             print(f"HTTP错误: {e}")
#         except httpx.RequestError as e:
#             print(f"请求错误: {e}")
#         except httpx.SSLError as e:
#             print(f"SSL错误: {e}")
#
#
# # 运行异步请求
# import asyncio
#
# asyncio.run(make_request())



